package com.aaa.controller;

import com.aaa.entity.MyReturn;
import com.aaa.entity.ViewTestResultSds;
import com.aaa.service.ViewTestResultSdsService;
import com.github.pagehelper.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * @author ：dudu（12232347710@qq.com）
 * @date ：Created in 2022/7/7 19:32
 * @description：
 * @modified By：
 */
@Controller
@RequestMapping("tblTesterSds")
public class ViewTestResultSdsController extends BaseController{
    MyReturn myReturn = new MyReturn();
    @Autowired
    private ViewTestResultSdsService viewTestResultSdsService;
    @RequestMapping("testerSds.do")
    private String Pages() {
        return "testerSdS";
    }
    /**
     *
     * @param viewTestResultSds
     * @return MyReturn
     *  查询  模糊查询
     */
    @ResponseBody
    @RequestMapping("selectTblTesterSds.do")
    public MyReturn selectTblTesterSds(ViewTestResultSds viewTestResultSds){
        System.out.println(viewTestResultSds);
        Page page = viewTestResultSdsService.selectResultSds(viewTestResultSds);
        //获取查询结果
        myReturn.setData(page.getResult());
        //获取总条数
        myReturn.setCount(page.getTotal());
        return super.getSuccessResult(myReturn);
    }
    /*
     * 抑郁程度测试
     * */

    @RequestMapping("seleSdsCount.do")
    @ResponseBody
    public MyReturn seleSasCount(){
        Map<String, Integer> map = viewTestResultSdsService.seleTeseSdsUser();
        myReturn.setData(map);
        return super.getSuccessResult(myReturn);
    }
    @RequestMapping("testerFormSds.do")
    private String Page() {
        return "viewSdsForm";
    }


}
